﻿using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;

public class UEnter : MonoBehaviour {
	private void LateUpdate(){
		GameObject tempClick = EventSystem.current.currentSelectedGameObject;//当前事件系统下处于活动状态的物体
		if(tempClick!=null&&tempClick.transform.IsChildOf(this.transform)){//IsChildOf调用者是否是参数里的游戏对象的孩子
			if(Input.GetMouseButtonDown(0)){
				RoundUi tempRoundUiC=tempClick.GetComponentInParent<RoundUi>();
				if(tempRoundUiC!=null){
					if(tempRoundUiC.CheckFrontTra(tempClick.transform)){
						tempRoundUiC.SetAutoStopTime ();
						Debug.Log("click");
					}
				}
			}
		}
	}
}
